home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS069.dsk
/
FOX AND HOUNDS.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
4KB
|
150 lines
50 PRINT "WANT INSTRUCTIONS";
55 PRINT "TYPE YES OR NO";
60 INPUT A$
70 IF A$ = "YES" THEN GOSUB 1500
110 DIM L(9,9)
200 REM
210 FOR C = 1 TO 8 STEP 2
220 L(1,C) = 1
230 L(1,C +1) = 2
240 NEXT C
250 FOR C = 1 TO 8 STEP 2
255 L(2,C) = 4
260 L(2,C +1) = 1
265 L(3,C +1) = 4
270 L(3,C) = 1
275 L(4,C) = 4
280 L(4,C +1) = 1
285 L(5,C) = 1
290 L(5,C +1) = 4
295 L(6,C) = 4
300 L(6,C +1) = 1
305 L(7,C) = 1
310 L(7,C +1) = 4
312 L(8,C) = 4
315 L(8,C +1) = 1
320 NEXT C
330 L(8,5) = 3
340 X = 8
350 Y = 5
360 A = X
370 B = Y
400 REM
405 PRINT CHR$(16); CHR$(22)
406 GOSUB 1400
410 FOR L = 1 TO 8
420 FOR C = 1 TO 8
430 IF L(L,C) = 1 THEN PRINT "X ";
435 INVERSE
440 IF L(L,C) = 2 THEN PRINT "H ";
450 IF L(L,C) = 3 THEN PRINT "F ";
455 NORMAL
460 IF L(L,C) = 4 THEN PRINT "0 ";
470 NEXT C
480 PRINT " L";L
490 NEXT L
500 FOR K = 1 TO 8
510 PRINT K;" ";
520 NEXT K
530 PRINT
540 IF X = 1 THEN GOTO 1350
560 IF Z = 1 THEN 1300
600 REM
610 PRINT "YOUR MOVE FROM (LINE,COLUMN) ";
620 INPUT F,F1
630 PRINT "TO ";
640 INPUT T,T1
650 IF T <F THEN PRINT "YOU CAN'T MOVE BACKWARDS"
655 IF T <F THEN GOTO 600
660 IF T -F < >1 THEN 700
680 IF L(F,F1) < >2 THEN 700
690 IF L(T,T1) = 4 AND L(F,F1) = 2 THEN 720
700 PRINT "INVALID MOVE"
710 GOTO 600
720 L(T,T1) = 2
730 L(F,F1) = 4
903 Q = 0
905 K = INT( RND(0) *2)
910 IF K >2 THEN 905
930 IF K = 1 THEN 950
940 IF K = 0 THEN 1060
950 Q = Q +1
953 X = A -1
955 Y = B -1
960 IF L(X,Y) = 4 THEN L(X,Y) = 3
970 IF L(X,Y) < >3 AND Q < >2 THEN 1060
975 IF L(X,Y) < >3 AND Q = 2 THEN 1100
980 IF L(X,Y) = 3 THEN L(X +1,Y +1) = 4
990 IF L(X,Y) = 3 THEN 400
1060 X = A -1
1062 Y = B +1
1065 Q = Q +1
1070 IF L(X,Y) = 4 THEN L(X,Y) = 3
1080 IF L(X,Y) < >3 AND Q <2 THEN 950
1082 IF L(X,Y) < >3 AND Q = 2 THEN 1100
1085 IF L(X,Y) = 3 THEN L(X +1,Y -1) = 4
1090 IF L(X,Y) = 3 THEN 400
1100 REM
1101 IF K = 0 THEN 1105
1102 IF K = 1 THEN 1200
1105 Q = Q +1
1110 X = A +1
1115 Y = B +1
1120 IF L(X,Y) = 4 THEN L(X,Y) = 3
1130 IF L(X,Y) < >3 AND Q <4 THEN 1200
1150 IF L(X,Y) = 3 THEN L(X -1,Y -1) = 4
1160 IF L(X,Y) = 3 THEN 400
1170 IF L(X,Y) < >3 THEN Z = 1
1180 GOTO 400
1200 REM
1210 Y = B -1
1211 X = A +1
1215 Q = Q +1
1220 IF L(X,Y) = 4 THEN L(X,Y) = 3
1230 IF L(X,Y) < >3 AND Q <4 THEN 1105
1240 IF L(X,Y) = 3 THEN L(X -1,Y +1) = 4
1250 IF L(X,Y) = 3 THEN 400
1260 IF L(X,Y) < >3 THEN Z = 1
1270 GOTO 400
1300 REM
1310 PRINT "YOU WIN...WANT TO PLAY AGAIN";
1320 GOTO 1370
1360 PRINT "I WIN...WANT TO PLAY AGAIN";
1370 INPUT A$
1380 IF A$ = "YES" THEN GOTO 200
1390 END
1400 REM
1405 IF A = X THEN 1440
1406 IF Z = 1 THEN PRINT "I CAN'T MOVE"
1407 IF Z = 1 THEN 1440
1410 PRINT "I MOVED FROM";A;" ";B;"TO ";X;" ";Y
1420 A = X
1430 B = Y
1440 RETURN
1500 REM
1505 PRINT CHR$(16); CHR$(22)
1510 PRINT "YOU ARE THE HOUNDS. "
1520 PRINT "YOU HAVE FOUR PLAYERS (H)."
1530 PRINT "YOU CAN MOVE FORWARD ONLY."
1535 PRINT
1540 PRINT "THE COMPUTER IS THE FOX (F)."
1550 PRINT "THE FOX CAN MOVE BACK AND FORWARD."
1555 PRINT
1560 PRINT "IF YOU TRAP THE FOX YOU WIN."
1570 PRINT "IF THE FOX GETS TO LINE ONE."
1580 PRINT "THE COMPUTER WINS."
1590 PRINT "TYPE A RETURN TO CONTINUE";
1600 INPUT A$
1610 PRINT CHR$(16); CHR$(22)
1620 PRINT "TO PLAY..WHEN IT IS YOUR MOVE"
1630 PRINT "TYPE IN A LINE NUMBER"
1640 PRINT "COMMA COLUMN NUMBER OF THE "
1650 PRINT "MAN YOU WANT TO MOVE."
1655 PRINT
1660 PRINT "THEN WHEN I ASK TO?"
1670 PRINT "TYPE IN LINE NUMBER"
1680 PRINT "COMMA COLUMN YOU WANT TO"
1690 PRINT "MOVE TO. GOOD LUCK."
1700 PRINT "TYPE A RETURN WHEN READY";
1710 INPUT A$
1720 RETURN